package org.example.bookssystem.controller;

import org.example.bookssystem.Service.BookService;
import org.example.bookssystem.model.BookInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * Description:做渐进主义的改良派,不做完没注意的速成派
 * User: XALEXC
 * Date: 2024-10-23
 * Time: 11:17
 */
@RequestMapping("/book")
@RestController
public class BookController {

    @Autowired
    private BookService bookService;

    @RequestMapping("/getBookList")
    public List<BookInfo> getBookList(){
        // 1.获取图书的数据
        // 2.对数据进行处理
        // 3.返回数据
        // mock: 表示虚拟的,假数据
        List<BookInfo> bookInfos = bookService.getBookInfos();
        return bookInfos;
    }
    }
